/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.permission.service;

import com.alibaba.fastjson.JSONObject;
import com.legendshop.dao.support.PageSupport;
import com.legendshop.oa.dto.AdminUserTaskEstimateDto;
import com.legendshop.oa.model.AdminUser;
import com.legendshop.oa.model.Role;

import java.util.Date;
import java.util.List;

/**
 * 用户服务.
 */
public interface AdminUserService  {

    public AdminUser getAdminUser(Long id);
    
    public void deleteAdminUser(AdminUser adminUser);
    
    public Long saveAdminUser(AdminUser adminUser);

    public void updateAdminUser(AdminUser adminUser);

	public Boolean isAdminUserExist(String userName);

	public int updateAdminUserPassword(Long id, String newPassword);

	public List<Role> loadRole(String appNo);

	public List<Role> loadRole(Long userId, String appNo);

	public PageSupport<AdminUser> getAdminUser(String curPageNO, AdminUser adminUser);

	public JSONObject userList(String q, Integer pageSize, Integer currPage);

	public JSONObject userListForMyColleague(boolean isAdmin, String q, Integer pageSize, Integer currPage, String leaderName);

	public JSONObject userListForTeam(Long projectId, String q, Integer pageSize, Integer currPage);

	public JSONObject userListInTeam(Long projectId, String q, Integer pageSize, Integer currPage);

	public AdminUser getAdminUserByUserName(String userName);

	public boolean isUserExist(String userName);

	public PageSupport<AdminUser> getAdminUserByDept(String curPageNO, AdminUser adminUser, Date startDate, Date endDate);

	/**
	 * 每个用户的消耗统计
	 * @param userName
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	List<AdminUserTaskEstimateDto> getAdminUserTaskEstimate(String userName, Date startDate, Date endDate);
}
